<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE html>
<html lang="zh-CN">
<head>
	<meta charset="UTF-8">
	<title><?php echo ('订单结算' == '['.'title'.']' ? C('WEBSITE_NAME') : '订单结算');?></title>
	<meta name="viewport" content="initial-scale=1, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
    <meta content="yes" name="apple-mobile-web-app-capable">
	<meta content="red" name="apple-mobile-web-app-status-bar-style">
	<meta name="format-detection" content="telphone=no">
	<link rel="stylesheet" href="/css/mall.css?modify=20161026">
	<link rel="stylesheet" href="/css/trade.css?modify=20161026">
	<link rel="stylesheet" href="/css/red.css">
	<script type="text/javascript">
	var require = {
		baseUrl: '/js',
		waitSeconds: 0,
		map: {
		  '*': {
			'css': '//cdn.bootcss.com/require-css/0.1.8/css.min.js',
			'text': '//cdn.bootcss.com/require-text/2.0.12/text.min.js'
		  }
		},
		shim: {
			swiper: ['jquery', 'css!//cdn.bootcss.com/Swiper/3.3.1/css/swiper.min.css'],
			lazyload: ['jquery'],
		},
		paths: {
            'jquery': '//cdn.bootcss.com/jquery/1.12.4/jquery.min',
			'template': 'template',
			'validatejs': '//cdn.bootcss.com/jquery-validate/1.15.0/jquery.validate.min',
			'weixinjs': 'https://res.wx.qq.com/open/js/jweixin-1.0.0',
			'lazyload': '//cdn.bootcss.com/jquery.lazyload/1.9.1/jquery.lazyload.min',
			'swiper': '//cdn.bootcss.com/Swiper/3.3.1/js/swiper.min',

			'mall/cart': 'h5.js?modify=20161026',
			'view/order/list': 'h5.js?modify=20161026',
			'view/balance': 'h5.js?modify=20161026',
			'module/cart/num': 'h5.js?modify=20161026',
			'order/address': 'h5.js?modify=20161026',
			'pay': 'h5.js?modify=20161026',
			'view/personal/edit': 'h5.js?modify=20161026',
			'view/personal/scoreDetail': 'h5.js?modify=20161026',
			'view/present/list': 'h5.js?modify=20161026',
			'view/score': 'h5.js?modify=20161026',
			'pay/express': 'h5.js?modify=20161026',
			'jsweixin': 'h5.js?modify=20161026',
			'skumodal': 'h5.js?modify=20161026',
			'customer_service': 'h5.js?modify=20161026',
			'order/refund': 'h5.js?modify=20161026',
			'model_pay_coupon': 'h5.js?modify=20161026',
			'login_modal': 'h5.js?modify=20161026',
			'member/collection': 'h5.js?modify=20161026',
            'pullfresh': 'h5.js?modify=20161026',
            'goods_list': 'h5.js?modify=20161026',
          	'search': 'h5.js?modify=20161026',
		}
	}
	</script>
	<?php if(IS_APP): ?><script type="text/javascript" src="/js/appcan.min.js"></script><?php endif; ?>
	<script data-main="/js/h5.js?modify=20161026" src="//cdn.bootcss.com/require.js/2.3.1/require.min.js"></script>
	<?php if(!APP_DEBUG){ require_once 'cs.php';echo '<img src="'._cnzzTrackPageView(1259294058).'" width="0" height="0" style="display:none;"/>'; } ?>
<style>
.select-express{position:relative; font-size:12px}
.select-express select{opacity:0;position:absolute;width:100%;height:100%;left:0;right:0;top:0;bottom:0;}
.select-express.error{color:red}
.select-express .express_name{color:#ddd}
.arrow{line-height:20px;margin-right: 10px}
.arrow:after{content:'';position:absolute;width:7px;height:7px;border-top:2px solid #cbc9cc;border-right:2px solid #cbc9cc;-webkit-transform:rotate(45deg);-moz-transform:rotate(45deg);-ms-transform:rotate(45deg);transform:rotate(45deg);top:15px;right:12px}
</style>
</head>
<body>
	<div class="container js-page-content wap-page-order">
		<div class="content confirm-container">
			<div style="background: #ff7e00;background-size: auto 100%;position: static;padding: 20px;color: #fff;">
				<div>
					<h3>提示</h3>
					<p style="font-size: 12px;margin-top: 5px;line-height:15px;">
					<?php echo empty($error_msg) ? '待支付订单'.(C('ORDER_TIME_OUT')/3600).'小时后自动取消<br>付款后减库存，先付先得' : $error_msg ?>
					</p>
				</div>
			</div>
			<div class="block express" id="js-logistics-container" style="margin-top: -1px;">
				<div class="js-logistics-content logistics-content js-express">
					<div class="block form border-top-0 border-bottom-0">
						<div class="js-edit-address js-order-address express-panel express-panel-edit empty-address" style="padding-left: 0;">
							<ul class="express-detail">
								<li>添加收货地址</li>
							</ul>
						</div>
					</div>
					<div class="js-logistics-tips logistics-tips font-size-12 c-orange hide">很抱歉，该地区暂不支持配送。</div>
				</div>
				<!-- <div class="js-logistics-content logistics-content js-self-fetch"></div> -->
			</div>
			<!-- 商品列表 -->
			<div class="js-goods-list-container">
			<?php if(is_array($groups)): foreach($groups as $seller_id=>$group): ?><div class="block block-list block-order" data-seller_id="<?php echo ($seller_id); ?>">
				<div class="header" style="padding-left: 0px;">
					<span>店铺：<?php echo ($group['seller_nick']); ?></span>
				</div>
				<?php if(is_array($group['trades'])): foreach($group['trades'] as $freight_tid=>$trade): ?><div class="trade-item" data-freight_tid="<?php echo ($freight_tid); ?>">
					<?php if(is_array($trade['orders'])): foreach($trade['orders'] as $key=>$product): ?><a href="/h5/goods?id=<?php echo ($product["goods_id"]); ?>" class="js-goods-item block-item name-card name-card-3col name-card-goods clearfix">
						<div class="thumb"><img src="<?php echo ($product["pic_url"]); ?>"></div>
						<div class="detail">
							<h3 class="l2-ellipsis"><?php echo ($product["title"]); ?></h3>
							<p class="c-gray ellipsis"><?php echo ($product["spec"]); ?></p>
							<p class="js-error c-orange ellipsis"><?php echo ($product["error_msg"]); ?></p>
						</div>
						<div class="right-col">
							<div class="price" id="product-<?php echo ($product["product_id"]); ?>">¥<span><?php echo ($product["discount_price"]); ?></span></div>
							<div class="num">×<span class="num-txt"><?php echo ($product["num"]); ?></span></div>
						</div>
						<div class="goods-action"></div>
					</a><?php endforeach; endif; ?>
					<div id="discount-<?php echo ($seller_id); ?>-<?php echo ($freight_tid); ?>" class="block-item font-size-12 js-discount">
						<span>店铺优惠</span>
						<div class="pull-right arrow">¥0.00</div>
					</div>
                    <div id="express-<?php echo ($seller_id); ?>-<?php echo ($freight_tid); ?>" class="js-select-express block-item select-express">
                        <span>配送方式</span>
                        <div class="pull-right arrow" data-freight_tid="<?php echo ($trade['freight_tid']); ?>">请选择</div>
                        <select><option value="">请添加收货地址</option></select>
                    </div>
					<div class="block-item order-message clearfix js-order-message" data-type="msg">
						<textarea id="remark-<?php echo ($seller_id); ?>-<?php echo ($freight_tid); ?>" class="js-msg-container font-size-12" placeholder="给卖家留言..."></textarea>
					</div>
				</div><?php endforeach; endif; ?>
				<div class="block-item">
					合计<div class="pull-right"><span class="c-orange" id="seller-<?php echo ($seller_id); ?>-total">¥0.00</span></div>
				</div>
			</div><?php endforeach; endif; ?>
			</div>
			<div class="js-order-total block border-top-0">
				<div class="block-item order-total">
					<p>
						<span>商品总价</span>
						<span class="pull-right">¥0.00</span>
					</p>
					<p>
						<span>运费(快递)</span>
						<span class="pull-right">+ ¥0.00</span>
					</p>
					<p>
						<span>店铺优惠</span>
						<span class="pull-right">- ¥0.00</span>
					</p>
					<p>
						<span>积分抵用</span>
						<span class="pull-right">- ¥0.00</span>
					</p>
				</div>
				<div class="block-item">
					<p>
						<span>应付金额</span>
						<span class="pull-right c-orange">¥0.00</span>
					</p>
				</div>
			</div>
			
			<?php if(empty($has_error)): ?><!-- 支付 -->
			<div class="action-container" id="confirm-pay-way-opts">
				<div style="margin-bottom: 10px;">
					<p class="center c-gray-dark font-size-12" style="line-height:30px;">使用微信支付请确保已安装微信6.0.2以上版本</p>
					<button type="button" class="btn-pay btn btn-block btn-large btn-wxwappay btn-green">
						微信支付
					</button>
				</div>
			</div><?php endif; ?>
		</div>
	</div>
	
	<script type="text/javascript">
	var _data = <?php echo ($json_data); ?>;
	</script>
	<script src="/js/pay-confirm.js?modify=20161026"></script>
</body>
</html>